<?php
require_once 'Vega/Module/Action.php';
require_once 'Vega/Module/AjaxReturn.php';
require_once APP_PATH.DS.'includes/BbData.php';

class Client_SubmitAction extends Vega_Module_Action
{
	public $_return = null;
	
	public function __construct(Vega_App $app) {
		parent::__construct($app);
		$this->_return = new Vega_Module_AjaxReturn;
	}
		
    public function execute()
    {
		$this->setOption('output', FALSE);		
		
		$commonDao = Vega_Dao::factory('Bbservice_Common');
		
		$data = isset($_REQUEST['data'])?$_REQUEST['data']:'';
		
		if ($data != '') {
			$dataList = json_decode($data);
			
			$bbData = new BbData();			
			
			foreach ($dataList as $item) {
				$result = $bbData->save($item->ownerId, '', $item->responseContent);
			}
		}
    }
 
}